package action;

import biz.UserBiz;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String userName;
	private String shenFenZhengId;
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getShenFenZhengId() {
		return shenFenZhengId;
	}
	public void setShenFenZhengId(String shenFenZhengId) {
		this.shenFenZhengId = shenFenZhengId;
	}
	
	public String login(){
		UserBiz userBiz=new UserBiz();
		if(userBiz.checkLogin(userName, shenFenZhengId)){
			ActionContext ac=ActionContext.getContext();
			ac.getSession().put("userName", userName);
			return SUCCESS;
		}
		return INPUT;
	}

}
